<html>
<head>
    <meta charset="utf-8">
    <title><%=title %></title>
</head>

<%include easyui.ejs %>

<style type="text/css">
    .black_overlay
    {
        display: none;
        position: absolute;
        top: 0%;
        left: 0%;
        width: 100%;
        height: 100%;
        background-color: #f5f5f5;
        z-index: 1001;
        -moz-opacity: 0.8;
        opacity: .80;
        filter: alpha(opacity=80);
    }
    .black_overlay2
    {
        display: none;
        position: absolute;
        top: 0%;
        left: 0%;
        width: 100%;
        height: 100%;
        background-color: #f5f5f5;
        z-index: 1001;
        -moz-opacity: 0.8;
        opacity: .80;
        filter: alpha(opacity=80);
    }
    .white_content
    {
        display: none;
        position: absolute;
        top: 25%;
        left: 10%;
        width: 80%;
        border: 3px solid #D6E9F1;
        z-index: 1002;
        overflow: auto;
        background-color: white;
    }
    .white_content2
    {
        display: none;
        position: absolute;
        top: 25%;
        left: 10%;
        width: 80%;
        border: 3px solid #D6E9F1;
        z-index: 1002;
        overflow: auto;
        background-color: white;
    }
    html, body
    {
        height: 100%;
        width: 100%;
    }
    .STYLE2 {
        font-size: 30px;
        font-weight: bold;
    }
</style>


<script language="javascript" type="text/javascript">
    function goIframe1(url)
    {
        window.result.location.href="../update/"+url;
    }
    function goIframe2(url)
    {
        window.result1.location.href="../dele/"+url;
    }
    function show()
    {
        div2.style.display='block';
        fade.style.display='block';
    }
    function hide()
    {
        div2.style.display='none';
        fade.style.display='none';
        location.reload();
    }
    function show1()
    {
        div3.style.display='block';
        fade.style.display='block';
    }
    function hide1()
    {
        div3.style.display='none';
        fade.style.display='none';
        location.reload();
    }
</script>



<body class="easyui-layout">

<%include north.ejs%>


<div data-options="region:'west',split:true,title:'导航'" style="width:200px;padding:10px;">
  <%include menu.ejs%>
</div>



<div data-options="region:'center',title:'主页'">

    <table>
        <tr>
            <td width="86%" valign="top"><form name="form1" method="post" action="/zy">
                    <strong>
                        <div id="txt" align="right"></div>
                    </strong>
                    <label style="font-size: 20px">部门
                        <select name="dep" style="font-size: 17px">
                            <option></option>
                            <% var menu %>
                            <% if(menu) { %>
                            <% menu.forEach(function(menus, index) { %>
                            <% if (menus.dep!=bumen) { %>
                            <option><%= menus.dep %></option>
                            <% } else { %>
                            <option selected="selected"><%= menus.dep %></option>
                            <% } %>
                            <% }) %>
                            <% } %>
                        </select>
                    </label>
                    <p>
                        <label style="font-size: 20px">姓名
                            <input type="text" name="ip_name" value="<%=name%>">
                        </label>
                    </p>
                    <p>
                        <label style="font-size: 20px">MAC
                            <input type="text" name="mac" value="<%=macadress%>">
                        </label>
                        <label>
                            <input type="submit" name="Submit" value="查询">
                        </label>
                    </p>
                </form>
        </tr>
    </table>

    <table  class="easyui-datagrid" data-options="
              rownumbers:true,
				singleSelect:true,
				autoRowHeight:false" >
        <thead>
        <tr>
            <th data-options="field:'id',width:140">ID</th>
            <th data-options="field:'dep',width:140">部门</th>
            <th data-options="field:'ip_name',width:140">姓名</th>
            <th data-options="field:'mac',width:140">MAC地址</th>
            <th data-options="field:'oper',width:140">操作</th>
        </tr>
        </thead>
        <tbody>
        <% var content %>
        <% if(content) { %>
        <% content.forEach(function(contents, index) { %>
        <tr >
            <td><%= contents.ip_name %></td>
            <td><%= contents.dep %></td>
            <td><%= contents.states %></td>
            <td><%= contents.mac %></td>
            <td><a href="javascript:goIframe1('<%=contents.id %>@<%=contents.dep %>@<%=contents.ip_name%>@<%=contents.mac%>');"
                   onclick="javascript:show()">修改</a>
                <a href="javascript:goIframe2('<%=contents.id %>@<%=contents.dep %>@<%=contents.ip_name%>@<%=contents.mac%>');"
                   onclick="javascript:show1()" >删除</a>
            </td>
        </tr>
        <% }) %>
        <% } %>
        </tbody>
    </table>
    <br>
    <br />
    <div style="text-align: center">
        <%if(page>1){%>
        <a href="../zy/<%= page-1 %>">上一页</a>
        <%}else{%>
        <label>首页</label>
        <%}%>
        <a href="../zy/<%= page+1 %>">下一页</a>
    </div>
    </td>
</div>

<div id="div2" class="white_content" style="left: 20%; top: 10%; width: 45%; height: 720px;">
    <div style="text-align: right">
        <a onMouseOver="this.style.cursor='hand'" onClick="javascript:hide()">关闭</a>
    </div>
    <div>
        <iframe id="result" name="result" frameborder="0" marginheight="0" marginwidth="0"scrolling="no" src="" style="width:100%; height: 700px;"></iframe>
    </div>
</div>

<div id="div3" class="white_content" style="left: 40%; top: 30%; width: 25%; height: 200px;">
    <div style="text-align: right">
        <a onMouseOver="this.style.cursor='hand'" onClick="javascript:hide1()">关闭</a>
    </div>
    <div>
        <iframe id="result1" name="result1" frameborder="0" marginheight="0" marginwidth="0"scrolling="no" src="" style="width: 100%; height: 180px;"></iframe>
    </div>
</div>

<div id="fade" class="black_overlay">
</div>

</body>
</html>

